home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mntlib44.zoo
/
mntlib
/
killpg.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-02-22
|
834b
|
48 lines
/* killpg() for MiNT */
#include <stdlib.h>
#include <errno.h>
#include <osbind.h>
#include <signal.h>
#include <unistd.h>
#include <mintbind.h>
extern int __mint;
/* vector of signal handlers (for TOS) */
extern __Sigfunc _sig_handler[]; /* in signal.c */
/* vector giving which signals are currently blocked from delivery (for TOS) */
extern long _sigmask; /* in signal.c */
/* which signals are pending? */
extern long _sigpending;
int
killpg(pgrp, sig)
int pgrp, sig;
{
long r;
if (__mint == 0) {
if (pgrp == 0 || pgrp == getpgrp())
return kill(getpid(), sig);
errno = EINVAL;
return -1;
}
if (pgrp < 0) {
errno = ERANGE;
return -1;
}
r = Pkill(-pgrp, sig);
if (__mint < 7) { /* compensate for a bug in MiNT 0.6 */
(void)Syield();
}
if (r < 0) {
errno = (int) -r;
return -1;
}
return 0;
}